﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework.Graphics;

namespace SimplexEngine
{
    internal class FontResourceLoader : IResourceLoader
    {
        public List<String> GetSupportFormats()
        {
            List<String> support_formats = new List<String>();
            support_formats.Add(".FONT");
            return support_formats;
        }

        public ResourceType GetResourceType()
        {
            return ResourceType.FONT;
        }

        public Object LoadResource(String path)
        {
            String file_name = Helper.GetFullPathWithoutExtension(path);

            try
            {
                return Root.Instance.ContentManager.Load<SpriteFont>(file_name);
            }
            catch
            {
                return null;
            }
        }
    }
}